#pragma once
#include <vector>
#include <iostream>
using namespace std;


namespace my_stl
{
    template <size_t N>
    class mybitset
    {
    public:
        // 构造函数
        mybitset()
        {
            _bits.resize(N / 8 + 1);
        }
        // 设置比特位
        void set(size_t x)
        {
            size_t i = x / 8;
            size_t j = x % 8;
            _bits[i] |= (1 << j);
        }
        void reset(size_t x)
        {
            size_t i = x / 8;
            size_t j = x % 8;
            _bits[i] &= ~(1 << j);
        }
        // 判断是否有x
        bool test(size_t)
        {
            size_t i = x / 8;
            size_t j = x % 8;
            return _bits[i] & (1 << j);
        }

    private:
        vector<char> _bits;
    };
}